package com.geetour.columbus.common.test.mysql;

import javax.sql.DataSource;

import org.dbunit.DataSourceDatabaseTester;
import org.dbunit.database.IDatabaseConnection;

/**
 * Oracle Database Tester
 *
 * @author ChenKai
 * @since 2012-05-09
 */
public class MysqlDatabaseTester  extends DataSourceDatabaseTester {

	private DataSource dataSource;

	public MysqlDatabaseTester(DataSource dataSource, String schema) {
		super(dataSource, schema);
		this.dataSource = dataSource;
	}

	public MysqlDatabaseTester(DataSource dataSource) {
		super(dataSource);
		this.dataSource = dataSource;
	}

	@Override
	public IDatabaseConnection getConnection() throws Exception {
		return new MysqlDatabaseConnection( dataSource.getConnection(), getSchema() );
	}

}
